// src\store\mutations.js
export default{
    add (state, payload){
        state.count = state.count + payload.count
    },
    min (state, payload){
        state.count = state.count - payload.count
    },
    // 被 actions.js 中的方法触发，更新 state.js 中的 cartCount 的值
    addCart  (state, payload) {
        state.cartCount = payload.count
    }
}